<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
<link
	href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css"
	rel="stylesheet">
<title>添加商品</title>


</head>
<body>
	<jsp:include page="../top.jsp"></jsp:include>
	<div class="container">
		<div class="row clearfix">
			<h1>添加商品</h1>
			<div class="col-md-12 column">
				<form role="form" action="../goods/doaddAction" method="post">
					<div class="form-group">
						<label>商品名称</label><input type="text" class="form-control"
							name="goodsname" />
					</div>
					<div class="form-group">
						<label>价格</label><input type="text" class="form-control"
							name="price" />
					</div>
					<div class="form-group">
						<label>数量</label><input type="number" class="form-control"
							name="number" />
					</div>
					<div class="form-group">
						<label>选择供应商</label><select name="supplier">
							<c:forEach var="items" items="${allsupplier }">
								<option value="${items.supplier_id }">${items.supplier_name }</option>
							</c:forEach>
						</select>
					</div>
					<div class="form-group">
						<label>选择仓库</label><select name="warehouse">
							<c:forEach var="items" items="${allwarehouse }">
								<option value="${items.warehouse_id }">${items.warehouse_name }</option>
							</c:forEach>
						</select>
					</div>
					<button type="submit" class="btn btn-default btn-block btn-primary">按钮</button>
					<!-- <button type="submit" class="btn btn-default">Submit</button> -->
				</form>
			</div>
		</div>
	</div>

	<%-- 	<form action="../goods/addGoods" method="post" id="myform">
		<input id="goodsname" type="text" name="goodsname" placeholder="商品名称">
		<br> <input id="goodprice" type="text" name="goodprice"
			placeholder="商品价格"> <br> <input id="goodsnumber"
			type="text" name="goodsnumber" placeholder="商品数量"> <br>
		<select name="supplierid">
			<c:forEach items="${ allsupplier}" var="supplier">
				<option value="${supplier.supplier_id }">${ supplier.supplier_name}</option>
			</c:forEach>
		</select> <select name="warehouseid">
			<c:forEach items="${ allwarehouses }" var="item">
				<option value="${ item.warehouse_id}">${ item.warehouse_name }</option>
			</c:forEach>
		</select> <a href="javascript:check()">提交</a>
	</form> --%>
	<!-- 	<script type="text/javascript">
	function check() {
		var name = document.getElementById("goodsname").value;
		var price = document.getElementById("goodprice").value;
		var number = document.getElementById("goodsnumber").value;
		if (name == null || name == "") {
			alert("请输入商品信息！");
			console.log("请输入商品信息！")
			name.focus();
			return;
		}
		if (price == null || price == "") {
			alert("请输入商品价格！")
			price.focus();
			return ;
		}
		if (number == null || number == "") {
			alert("请输入商品数量！");
			number.focus();
			return ;
		}
		document.getElementById("myform").submit();
	}
</script> -->
	<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
	<script src="https://cdn.bootcss.com/jquery/1.12.4/jquery.min.js"></script>
	<!-- Include all compiled plugins (below), or include individual files as needed -->
	<script
		src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
</body>
</html>